﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using SystemDirectory.DAO;
using SystemDirectory.Common;
using SystemDirectory.Entity;


namespace SystemDirectory.Biz
{
    public class BOPremise
    {
        public DataTable Get(bool ShowInactive,Utilities.SearchType IsSearch)
        {
            DAOPremise daoContact = new DAOPremise();
            DataTable dtResult = daoContact.Get(ShowInactive,IsSearch);
            return dtResult;
             
        }
        public int GetLastId() 
        {
            DAOPremise daoPremise = new DAOPremise();
            return daoPremise.GetLastId();
        }
        public bool AddPremise(Premise premiseIn)
        {
            DAOPremise daoPremise = new DAOPremise();
            return daoPremise.AddPremise(premiseIn);
        }
        public Premise GetById(int id)
        {
            DAOPremise daoPremise = new DAOPremise();
            return daoPremise.GetById(id);
        }
        public bool UpdatePremise(Premise premiseIn)
        {
            DAOPremise daoPremise = new DAOPremise();

            return daoPremise.UpdatePremise(premiseIn);
        }
        public bool CheckName(String name)
        {
            DAOPremise boCheck = new DAOPremise();
            return boCheck.CheckLocationName(name);
        }
    }
}